#pragma once

#include "cyber/common/macros.h"
#include "cyber/common/log.h"
#include <time.h>

namespace apollo {
namespace drivers {
namespace lidar_hesai {

class MakeTime {
 public:
  time_t mktime(tm* fp) const;
  int64_t mktime_kernel(tm* tp) const;  // Return UTC Time.
  ~MakeTime();
  DECLARE_SINGLETON(MakeTime)

 private:

  // The difference between UTC time and local time, which is the time zone.
  int64_t timezone_offset_;
  // January 1, 1970 is the 719499th day from January 1, 1 AD.
  const int kEpochOffsetDays{719499};
  // Special numbers. Example: If mon = 2, then days = 367 * mon / 12 = 61.
  const int kCalcMonthDays{367};
};

}  // namespace lidar_hesai
}  // namespace drivers
}  // namespace apollo
